package com.share.nacos.rest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author caifan
 * @created 2021/4/8
 * description:
 */
@RestController
@RequestMapping("/nacos/config")
public class ConfigRest {
    @Autowired
    private Environment environment;

    @GetMapping("/value")
    public String getValue(@RequestParam String key) {
        return environment.getProperty(key);
    }
}
